var express = require('express');
var router = express.Router();
router.use('/:index1/:index2', function (req, res, next) {
	if (req.params.index2) {
		res.render(req.params.index1 + '/' + req.params.index2 + '.jade');		
	} else {
		next();
	}
});
router.use('/:index', function (req, res, next) {
	if (!isNaN(Number(req.params.index))) {
		res.render(req.params.index + '.jade');
	} else {
		next();
	}
})
router.get('/', function (req, res, next) {
	res.render('index.jade');
});
module.exports = router;